/*
 * @Description:
 * @Author: zhangwei
 * @Date: 2023-02-02 15:52:39
 * @LastEditTime: 2023-03-03 15:18:08
 * @LastEditors: zhangwei
 */
import { createApp } from "vue";
import { createPinia } from "pinia";

import App from "./App.vue";
import router from "./router";

// 初始化多语言
import { setupI18n } from "@/plugins/vueI18n";

import "@/assets/icons/iconfont.css"; //图标1
import * as ElementPlusIconsVue from "@element-plus/icons-vue"; //引入element-plus图标

// 全局组件
import { setupDesignerCom } from "./components-designer/DesignerCmpRegist";
import { setupAttrSettingCom } from "./components-attr/AttrCmpRegist";

// 样式
import "@/styles/index.scss";

import "uno.css"; // focus code

//引入svg
import "virtual:svg-icons-register";


const setupAll = async () => {
  const app = createApp(App);

  await setupI18n(app);

  // 注册element-plus图标
  for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component);
  }

  setupDesignerCom(app);
  setupAttrSettingCom(app);

  app.use(createPinia());

  app.use(router);
  await router.isReady();

  app.mount("#app");
};

setupAll();
